package com.sxb.spike.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.sxb.spike.pojo.User;
import com.sxb.spike.vo.LoginVO;
import com.sxb.spike.vo.RespBean;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 沈小白
 * @since 2023-06-05
 */
public interface IUserService extends IService<User> {

    /**
     * 登录
     *
     * @param request
     * @param response
     * @param loginVO
     * @return
     */
    RespBean login(HttpServletRequest request, HttpServletResponse response, LoginVO loginVO);

    /**
     * 根据 cookie 获取用户
     * @param userTicket
     * @param request
     * @param response
     * @return
     */
    User getByUserTicket(String userTicket, HttpServletRequest request, HttpServletResponse response);

    /**
     * 更新密码
     * @param userTicket
     * @param id
     * @param password
     * @return
     */
    RespBean updatePassword(String userTicket, Long id, String password);
}
